function [ Ix,Iy] = ImageDerivatives( im )
%IMAGEDERIVATIVES Summary of this function goes here
%   Detailed explanation goes here

    %conv with the kernel
    Ix = conv2(im,0.5*[1 -1]);
    Iy = conv2(im,0.5*[1 ; -1]);
    
    %discard extra column/row
    Ix = Ix(:,1:end-1);
    Iy = Iy(1:end-1,:);
    
    %zero borders
    Ix([1 end],:) = 0;
    Ix(:,[1 end]) = 0;
    
    Iy([1 end],:) = 0;
    Iy(:,[1 end]) = 0;
end

